package org.sharkness.business.factory;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class PropertiesFactory {

	public static Properties ini;

	public InputStream getSharknessInputStream(String propFileName) {
        return this.getClass().getClassLoader().getResourceAsStream(propFileName);
	}
	
	public static Properties getSharknessProperties() {
		if (ini == null) {
			try {
				ini = new Properties();
	        	ini.load(
	        		new PropertiesFactory()
	        			.getSharknessInputStream("sharkness.ini")
	        	);
	        } catch (IOException e) {
	        	e.printStackTrace();
	        }
		}
		return ini;
	}
	
}